/*
 * @Author: 徐建辰
 * @Date: 2022-02-12 10:13:41
 * @LastEditTime: 2022-02-16 08:48:18
 * @LastEditors: 徐建辰
 * @Description: 全局注册vant，按需引入
 */
import {
  Button, Icon, Form, Field, Toast, Swipe, SwipeItem, Skeleton, 
  ActionBar, ActionBarIcon, ActionBarButton, PullRefresh, List,
  CheckboxGroup, Checkbox, SwipeCell, Stepper, SubmitBar, Divider,
  AddressList, AddressEdit, Popup, Tabs, Tab, Card
} from 'vant'

const components = [
  Button, Icon, Form, Field, Swipe, SwipeItem, Skeleton,
  ActionBar, ActionBarIcon, ActionBarButton, PullRefresh,
  List, CheckboxGroup, Checkbox, SwipeCell, Stepper, SubmitBar,
  Divider, AddressList, AddressEdit, Popup, Tabs, Tab, Card
]
const plugins = [Toast]
const Vant = {
  install: app => {
    components.forEach(i => app.component(i.name, i))
    plugins.forEach(p => app.use(p))
    app.config.globalProperties.$Toast = Toast
  }
}

export default Vant